GM 4.0 workaround (partially tested)#23
GM 4.0 workaround (partially tested)#23ilyvion merged 17 commits intoQuestionable-Content-Extensions:developfrom
Conversation
This shim has been tested on the release, but not on source.
Modified the grant-none shim to not take effect if GM_ functions still exist.
The original grant-none-shim.js would run even on GM versions that include the GM_ functions. This could cause breakage. Fixed to only create new functions if they don't already exist.
|
Hey, I really appreciate this! If you don't mind, though, I'd much rather have
Still, to honor your contribution, I'm most likely going to accept your pull request and then make my modifications afterwards, so you'll be part of the commit history. :) (*) I've made another userscript that uses a build system based on the one I made here, but with various improvements. Next I get to make edits to this repo, I'll backport them here. Among the improvements are ES6 support, moving the userbanner out into a separate file rather than crammed into a variable and by far the most effort-saving: automatic publishing of new releases through Travis when tagging a commit. |
Hopefully possible to inline and made pre-ES6 compatible
Thought it was causing problems, but apparently not.
|
No worries. I always intended this to be a stopgap, not permanent. The idea was to have a quick fix so people could use it in GM 4. I shimmed my own copy and was surprised I could make it work so easily. Hence wanted to share it, so I put it in the repo the easiest way I could just to get it done. That said, I went ahead and tried to fix what you mentioned (as you said you don't have time to work on it right now). I think I've got it all in repo now. I put all of the shim code into one file, removed the stuff that didn't have to do with storage, and reformatted until I got it to validate. Then I added it to the Grunt file. Unfortunately, I still can only "partially test" it. I added the script directly to the minified version and checked that it ran on GM 3, GM 4, and the latest TamperMonkey. But I seem to be unable to actually build the script from scratch. I ran I definitely agree that having it built by Travis would be an improvement. I spent way too long trying to find a way to pull out the file it produced when testing. |
|
When you say Mine eventually failed running because I've not enabled or turned on VT-x, but I did at least get output and stuff happening almost immediately. I haven't got time to deal with this pull request today, but I'm most likely going to have time tomorrow, so I'll process your contribution then. :) |
|
Yes, it just sits there after I put in the Anyways, I actually came back to note that there is one downside to my patch, in that it resets your settings on any userscript engine that supports the GM object, since the settings are now stored in a new place. So settings such as displaying all characters and places or having the small ribbon get reset. |
I decided that using the namespace as a name was a bad idea if you ever write another script, so I now use the initials from the script name. And since I was already updating anyways, I thought to reverse my previous decision and continue to use GM_ storage if possible, so settings won't be lost unless necessary. I also added a shim for GM_info, which I neglected before. It currently exists in GM 4, but it may be removed in the future, hence the weird testing. Not sure how many edits I should do in one commit, but this one is tested (as much as the rest).
See #21. This has only been tested on the full code, not the source. Updated node to avoid a travis error.